
package jpa;
import java.io.Serializable;
import java.util.*;
import javax.persistence.*;

/**
 * JPA Class OrderstatusJPA
 */
@Entity
@Table(name="practicalcase.orderstatus")
public class OrderstatusJPA implements Serializable {

	private static final long serialVersionUID = 1L;

	private String orderstatus;
	private Collection<OrderJPA> orders ; 
	
	/**
	 * Class constructor methods
	 */
	public OrderstatusJPA() {
		super();
	}	
	public OrderstatusJPA(String orderstatus) {		
		this.orderstatus = orderstatus;
	}
	
	/**
	 *  Methods get/set the fields of database
	 *  Id Primary Key field
	 */
	@Id
	public String getOrderstatus() {
		return orderstatus;
	}
	public void setOrderstatus(String orderstatus) {
		this.orderstatus = orderstatus;
	}
	
	/**
	 * Methods get/set persistent relationships
	 */
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER )
	@JoinColumn(name = "orderstatus") 
	public Collection<OrderJPA> getOrdersbyStatus() {
		return orders;
	}	
	public void setOrdersbyStatus(Collection<OrderJPA> orders) {
 		this.orders = orders; 
	}
}